package cn.webrx;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

public class Room implements Serializable {
    @Serial
    private static final long serialVersionUID = -5693307199417068731L;
    private int no;
    private int num;
    private double price;
    private Date enter; /*此房间入住时的日期时间*/
    private boolean state;
    private User user;

    public User getUser() {
        return user;
    }


    public Room(int no, int num, double price, Date enter, boolean state, User user, String info) {
        this.no = no;
        this.num = num;
        this.price = price;
        this.enter = enter;
        this.state = state;
        this.user = user;
        this.info = info;
    }

    public void setUser(User user) {
        this.user = user;
    }

    private String info;


    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Room() {
    }

    public Room(int no, int num, double price, Date enter, boolean state) {
        this.no = no;
        this.num = num;
        this.price = price;
        this.enter = enter;
        this.state = state;
    }


    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Date getEnter() {
        return enter;
    }

    public void setEnter(Date enter) {
        this.enter = enter;
    }

    public boolean isState() {
        return state;
    }

    public void setState(boolean state) {
        this.state = state;
    }


    @Override
    public String toString() {
        return "[" + getNo() + "]" + (state ? "有人" : "");
    }

    public String info() {
        return "Room{" +
                "no=" + no +
                ", num=" + num +
                ", price=" + price +
                ", enter=" + enter +
                ", state=" + state +
                ", user=" + user +
                ", info='" + info + '\'' +
                '}';
    }
}
